package dubrouski.triangulation;

/*
 * @author Stanislau Dubrouski
 */
public class Edge {

    private Vector3d p1;
    private Vector3d p2;

    public Edge() {
    }

    public Vector3d getP1() {
        return p1;
    }

    public void setP1(Vector3d p1) {
        this.p1 = p1;
    }

    public Vector3d getP2() {
        return p2;
    }

    public void setP2(Vector3d p2) {
        this.p2 = p2;
    }

    public Edge(Vector3d p1, Vector3d p2) {
        this.p1 = p1;
        this.p2 = p2;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Edge other = (Edge) obj;
        if (this.p1 != other.p1 && (this.p1 == null || !this.p1.equals(other.p1))) {
            return false;
        }
        if (this.p2 != other.p2 && (this.p2 == null || !this.p2.equals(other.p2))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 67 * hash + (this.p1 != null ? this.p1.hashCode() : 0);
        hash = 67 * hash + (this.p2 != null ? this.p2.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "Edge{" + "p1=" + p1 + ", p2=" + p2 + '}';
    }
}
